package es.cazadoresmadridejos.beans.manager.photo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import es.cazadoresmadridejos.beans.dao.photo.PhotoDao;
import es.cazadoresmadridejos.beans.manager.photo.PhotoManager;
import es.cazadoresmadridejos.common.bean.dao.Dao;
import es.cazadoresmadridejos.common.bean.manager.impl.ManagerImpl;
import es.cazadoresmadridejos.model.Photo;
import es.cazadoresmadridejos.model.Photo.PhotoType;
import es.cazadoresmadridejos.objs.PhotoContainer;
import es.cazadoresmadridejos.objs.web.Page;

@Service
public class PhotoManagerImpl extends ManagerImpl<Photo> 
	implements PhotoManager{

	@Autowired 
	public void setDao(@Qualifier("photoDao")
	Dao<Photo> dao) {
		this.dao = dao;
	}

	@Override
	public List<Photo> findAllPaginated(Page page, PhotoType type) {
		return ((PhotoDao)dao).findAllPaginated(page,type);
	}

	@Override
	public List<Photo> findAllPaginated(Page page, PhotoType type,
			Long partnerId) {
		return ((PhotoDao)dao).findAllPaginated(page,type, partnerId);
	}

	@Override
	public Long countAll(PhotoType type) {
		return ((PhotoDao)dao).countAll(type);
	}

	@Override
	public Long countAll(PhotoType type, Long partnerId) {
		return ((PhotoDao)dao).countAll(type, partnerId);
	}

	@Override
	public PhotoContainer getPhoto(Integer page, PhotoType type) {
		return ((PhotoDao)dao).getPhoto(page,type);
	}

}
